package cn.tiaf
package caiquan

import scala.io.StdIn

class User() extends Roller {
  override def showFirst(num: Int): Int = {
    println(s"请出拳! 1.剪刀 2.石头 3.布")
    val qidx = try {
      val idx = StdIn.readInt()
      if (idx > num) {
        println("输入不符合规范,默认出布")
        3
      } else idx
    } catch {
      case ex: Exception =>
        println("输入不符合规范,默认出布")
        3
    }
    qidx
  }
}
